package user

import (
	"go-init/lib/ctx"

	"github.com/gin-gonic/gin"
)

// SetRouter set user router
func SetRouter(r *gin.RouterGroup) {
	g := r.Group("/user")
	rs := new(USER)
	//user
	g.GET("/user_get", ctx.Handler(rs.UserGet))
	g.GET("/user_gets", ctx.Handler(rs.UserGets))
	g.POST("/user_save", ctx.Handler(rs.UserSave))
	//user_nav_auth
	g.GET("/user_nav_auth_get", ctx.Handler(rs.UserNavAuthGet))
	g.GET("/user_nav_auth_gets", ctx.Handler(rs.UserNavAuthGets))
	g.POST("/user_nav_auth_save", ctx.Handler(rs.UserNavAuthSave))
	//user_role
	g.GET("/user_role_get", ctx.Handler(rs.UserRoleGet))
	g.GET("/user_role_gets", ctx.Handler(rs.UserRoleGets))
	g.POST("/user_role_save", ctx.Handler(rs.UserRoleSave))
	//user_nav
	g.GET("/user_nav_get", ctx.Handler(rs.UserNavGet))
	g.GET("/user_nav_gets", ctx.Handler(rs.UserNavGets))
	g.POST("/user_nav_save", ctx.Handler(rs.UserNavSave))
	//user
	g.POST("/login", ctx.Handler(rs.Login))
	g.GET("/logout", ctx.Handler(rs.Logout))
	g.GET("/user_nav", ctx.Handler(rs.UserNav))
	g.GET("/check_login_status", ctx.Handler(rs.CheckLoginStatus))
	//user_operate
	g.GET("/user_operate_get", ctx.Handler(rs.UserOperateGet))
	g.GET("/user_operate_gets", ctx.Handler(rs.UserOperateGets))
	g.POST("/user_operate_save", ctx.Handler(rs.UserOperateSave))
	//user_operate_record
	g.GET("/user_operate_record_get", ctx.Handler(rs.UserOperateRecordGet))
	g.GET("/user_operate_record_gets", ctx.Handler(rs.UserOperateRecordGets))
	g.POST("/user_operate_record_save", ctx.Handler(rs.UserOperateRecordSave))
	//user_operate_table
	g.GET("/user_operate_table_get", ctx.Handler(rs.UserOperateTableGet))
	g.GET("/user_operate_table_gets", ctx.Handler(rs.UserOperateTableGets))
	g.POST("/user_operate_table_save", ctx.Handler(rs.UserOperateTableSave))
}
